﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="UC_CookList.ascx.cs" Inherits="Stationery.UC.UC_CookList" %>
<%@ Register Assembly="DevExpress.Web.ASPxGridView.v9.2, Version=9.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxGridView" TagPrefix="dxwgv" %>
<%@ Register Assembly="DevExpress.Web.ASPxEditors.v9.2, Version=9.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxEditors" TagPrefix="dxe" %>
<table cellpadding="0" cellspacing="5" width="100%" border="0">
    <tr>
        <td align="right">
            <dxe:ASPxButton ID="ASPxButtonAdd" runat="server" Text="Thêm mới" 
                onclick="ASPxButtonAdd_Click">
            </dxe:ASPxButton>
        </td>
    </tr>
    <tr>
        <td style="padding-top: 2px;">
            <dxwgv:ASPxGridView ID="ASPxGridViewCookList" runat="server" Width="100%" 
                AutoGenerateColumns="False" KeyFieldName="Cook_id" >
                <Styles>
                    <AlternatingRow Enabled="True">
                    </AlternatingRow>
                </Styles>
                <SettingsPager PageSize="15">
                    <Summary AllPagesText="Trang: {0} - {1} ({2} bản ghi)" Text="Trang {0}/{1} ({2} bản ghi)" />
                </SettingsPager>
                
                <Columns>
                    <dxwgv:GridViewDataTextColumn Caption="ID" FieldName="Cook_id" VisibleIndex="0" 
                        Width="30px">
                    </dxwgv:GridViewDataTextColumn>
                    <dxwgv:GridViewDataTextColumn Caption="Tiêu đề" FieldName="Title" 
                        VisibleIndex="1" Width="200px">
                    </dxwgv:GridViewDataTextColumn>
                    <dxwgv:GridViewDataDateColumn Caption="Ngày tạo" FieldName="Create_date" 
                        VisibleIndex="2" Width="80px">
                    </dxwgv:GridViewDataDateColumn>                              
                    <dxwgv:GridViewDataTextColumn Caption="Chức năng" VisibleIndex="7" Width="60px">
                        <DataItemTemplate>
                            <table cellpadding="0" cellspacing="0" align="center">
                                <tr>
                                    <td>
                                        <a href="Admin.aspx?id=cook&status=edit&cookid=<%# Eval("Cook_id") %>"><img alt="Sửa" src="Image/Icon/edit.gif" /></a>
                                    </td>
                                    <td width="5px">
                                    </td>
                                    <td>
                                        <asp:ImageButton ID="ImageButtonDelete" AlternateText="Xóa" runat="server" ImageUrl="~/Image/Icon/delete.gif"
                                            CommandArgument='<%# Eval("Cook_id") %>' OnClick="ImageButtonDelete_Click" OnClientClick="return confirm('Bạn chắc chắn muốn xóa?');" />
                                    </td>
                                </tr>
                            </table>
                        </DataItemTemplate>
                    </dxwgv:GridViewDataTextColumn>
                </Columns>                
            </dxwgv:ASPxGridView>
        </td>
    </tr>
</table>